import http from "../http";

export default {
    // 获取实时监测列表数据
    getMonitorData(id, params) {
        return http.get(`/health_monitoring/queryPointNumberByBridgeId`, {
            // headers: {'token': 'e59026dd-8d05-4ed9-8da1-1d31aadfaf20','app-key': '5ab089ca77014874868482ebb85b424b'}
            headers: {
                'app-key': params.appkey,
                token: params.token
            },
            params: {
                bridgeId: id
            }
        });
    },
    // 获取桥梁所有测点数据列表
    getBridgePointData(transmitId, params) {
        return http.get(`/device_measure_point/queryAllDeviceMeasurePointByBridgeId`, {
            // headers: {'token': 'e59026dd-8d05-4ed9-8da1-1d31aadfaf20','app-key': '5ab089ca77014874868482ebb85b424b'}
            headers: {
                'app-key': params.appkey,
                token: params.token
            },
            params: {
                ownId: transmitId.ownId,
                pageSize: transmitId.pageSize || 15,
                pageNum: transmitId.pageSize.pageNum || 1
            }
        });
    },
    // 实时荷载下的实时监测

    getMonitoringData(currentCurveData, params) {
        return http.get(`/health_monitoring/queryRealDataBySensorId`, {            // headers: {'token': 'e59026dd-8d05-4ed9-8da1-1d31aadfaf20','app-key': '5ab089ca77014874868482ebb85b424b'}
            headers: {
                'app-key': params.appkey,
                token: params.token
            },
            params: {
                bridgeId: currentCurveData.bridgeId,
                sensorId: currentCurveData.sensorId,
                sensorCode: currentCurveData.sensorCode
            }
        });
    },
    // 实时荷载下的历史监测
    getMonitoredData(historicalCurveData, params) {
        return http.get(`/health_monitoring/queryHistoryDataBySensorId`, {
            headers: {
                'app-key': params.appkey,
                token: params.token
            },
            params: {
                bridgeId: historicalCurveData.bridgeId,
                sensorId: historicalCurveData.sensorId,
                sensorCode: historicalCurveData.sensorCode,
                beginTime: historicalCurveData.beginTime,
                endTime: historicalCurveData.endTime
            }
        });
    },
    // 实时荷载下的超限监测
    getOverrunData(OverrunCurveData, params) {
        return http.get(`/health_monitoring/queryOverrunDataBySensorId`, {
            headers: {
                'app-key': params.appkey,
                token: params.token
            },
            params: {
                bridgeId: OverrunCurveData.bridgeId,
                sensorId: OverrunCurveData.sensorId,
                sensorCode: OverrunCurveData.sensorCode,
                beginTime: OverrunCurveData.beginTime,
                endTime: OverrunCurveData.endTime
            }
        });
    },
    // 测点下的传感器数据
    getSensorData(MeasuringId, params) {
        return http.get(`/device_sensor/queryDeviceSensorByMeasurePointId`,{
            headers: {
                'app-key': params.appkey,
                token: params.token
            },
            params: {
                pointId: MeasuringId
            }
        });
    }
};
